//
//  T1_6_CCell.swift
//  Pods
//
//  Created by eme on 2017/4/10.
//
//

/*
 owner:cy
 update:2017年04月10日18:17:03
 info: 图文类 cell
 VC :  HomePageVc
 */
import UIKit
import RxSwift
import RickonCore

class T1_6_CCell: UICollectionViewCell {
    
    @IBOutlet weak var title_Lb: UILabel!
    @IBOutlet weak var bg_ImgV: UIImageView!
    @IBOutlet weak var bg_V: UIView!
    
    var item:IndexModel?{
        didSet{
            if let item = self.item {
                if item.isDefault == 0 {
                    self.title_Lb.isHidden = true
                    self.bg_V.isHidden = true
                    self.bg_ImgV.isHidden = false
                    self.bg_ImgV.setUrlImage(item.pic, placeholderImage: "product-placeholder")
                }else{
                    self.bg_V.isHidden = false
                    self.title_Lb.isHidden = false
                    self.bg_ImgV.isHidden = true
                    self.title_Lb.text = item.title
                    self.title_Lb.font = UIFont(name: Theme.fontName, size: CGFloat(item.title_size))
                    self.title_Lb.textColor = UIColor(hex: item.title_color)
                    self.bg_V.backgroundColor = UIColor(hex: item.bg_color)
                }
            }
        }
    }
    
    override func awakeFromNib() {
        self.title_Lb.normal_fontSize(14)
    }
    
}
